﻿@model ThaireInvestmentWeb.Models.AddDepositInterestModel
@{
    ViewBag.Title = "Interest Payment Date : Deposit";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<script>
    function del(key)
    {
        showConfirm("ต้องการลบหรือไม่ ?", function ()
        {
            window.location.href= 'DeleteDepositInterestPaymentDate?interestId='+key;
            closeConfirm();
        });
        return false;
    }
</script>
<table class="navi" width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
        <td style="width: 100%;">
            <div class="navi">
                Instrument Type > <a href="@Url.Action("ManageDeposit", "Deposit", new { headerId = @Model.HeaderID })">Deposit at Financial Institutions</a> > <a href="@Url.Action("EditDepositHeader", "Deposit", new { headerId = Model.HeaderID })">Header</a> > Interest payment date
          
            </div>
        </td>
    </tr>
</table>

<table class="tableheader" width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
        <td height="38" align="center" style="width: 100%; text-align: center;">Interest Payment Date : Deposit</td>
    </tr>
</table>

<table width="951" border="0" align="center">
    <tr>
        <td>
            @using (Html.BeginForm("EditDepositHeader", "Deposit", FormMethod.Post, new { id = "mainForm" }))
            {
                @Html.ValidationSummary(true)

   

                <div style="width: 930px; overflow: auto;">
                    <br />
                    <br />
                    @if (Model.InterestPaymentDateAdapters != null && Model.InterestPaymentDateAdapters.Count > 0)
                    {
                        var grid = new WebGrid(source: Model.InterestPaymentDateAdapters, ajaxUpdateContainerId: "gridselected", rowsPerPage: 25, canSort: false);
                        @grid.GetHtml(htmlAttributes: new { id = "gridselected" }, tableStyle: "tablelist", headerStyle: "headertable", displayHeader: @Model.InterestPaymentDateAdapters.Count > 0,
            columns: grid.Columns(

                grid.Column(header: "NO.", format: item => (item.WebGrid.Rows.IndexOf(item) + 1) + (grid.PageIndex * grid.RowsPerPage), canSort: false),
                grid.Column(header: "Interest Payment Date", format: @<text> @ThaireInvestmentWeb.Util.WebUtil.FormatDate(item.PaymentDate) </text>),
                grid.Column(header: "ลบ", canSort: false, format: @<text>
                        <input type="image" id="BtnDelete"  = true name="BtnDelete"  onclick="return del('@item.InterestID    ')"  value="@item.InterestID" src="@Url.Content("~/Content/images/delete.png")"  title="ลบ"></text>)

                        ));
                    }
                    else
                    {                    
                        <table align="center" border="0" width="100%">
                            <tr>
                                <td style="text-align: center"><span class="error">ไม่พบข้อมูล</span></td>
                            </tr>
                        </table>
                    }
                </div>


            }
            <br>
        </td>
    </tr>
</table>
